package com.meida.module.bus.provider.mapper;

import com.meida.module.bus.client.entity.BusProject;
import com.meida.common.mybatis.base.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 项目表 Mapper 接口
 * @author flyme
 * @date 2020-09-25
 */
@Mapper
public interface BusProjectMapper extends SuperMapper<BusProject> {

    @Select("select t2.PROJECTCODE from bus_user_project t1 INNER JOIN bus_project t2 on t1.projectId = t2.projectId and t1.userId = #{userId} GROUP BY t2.PROJECTCODE")
    List<String> getProjectCodes(@Param("userId") Long userId);
}
